<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/


$home = array(
    'namespace'=>'Home',
    'middleware'=>['web','checkLogin']
);

Route::group(['middleware'=>'web','namespace'=>'Home'], function(){
    //登录
    Route::get('login',"LoginController@getLogin");
    Route::post('login',"LoginController@postLogin");
    Route::get('logout',"LoginController@loginOut");
    Route::get('invite/register','LoginController@postRegister');
    Route::post('invite/registerdo','LoginController@postRegisterProcess');
});

Route::group($home, function(){

    //首页
    Route::get('/',"IndexController@getIndex");
    Route::get('agentinfo','AgentController@getAgentInfo');
    Route::get('book','AgentController@getGenerateBook');
    //修改资料
    Route::get('bank','AgentController@getBank');
    Route::post('bank','AgentController@postBank');
    //系统信息
    Route::get('msg','MsgController@getMsg');
    Route::get('msg/detail/{id}/{type}','MsgController@getMsgDetai');
    //发布建议
    Route::get('feedback','MsgController@getFeedback');
    Route::post('feedback','MsgController@postFeedback');
    //防伪码查询
    Route::get('check/code','OrderController@getCheckCode');
    Route::post('check/code','OrderController@postCheckCode');
    //代理商码查询
    Route::get('check/agent','AgentController@getCheckAgent');
    Route::post('check/agent','AgentController@postCheckAgent');
    //我的销售统计
    Route::get('order/count','OrderController@getOrderCount');
    Route::post('order/count','OrderController@getOrderCount');
    //下级客户订单
    Route::get('order/fenxiao','OrderController@getFxOrder');
    //我的订单
    Route::get('order','OrderController@getOrderList');
    Route::post('order/del','OrderController@postOrderDel');
    Route::post('order/adres','OrderController@postAddAdres');
    Route::post('order/add','OrderController@postAddOrder');
    Route::get('order/detail','OrderController@getOrderDetail');
    Route::get('order/checkosn','OrderController@getCheckOrderSn');
    //发货
    Route::get('scan','JsController@getScan');
    //我要订货
    Route::get('goods','GoodsController@getIndex');

    //查看下级代理
    Route::get('agent/fenxiao','AgentController@getFxList');
    Route::get('agent/fenxiao/detail','AgentController@getFxDetail');

    //新代理加盟
    Route::get('agent/share','AgentController@getShare');

      Route::get('invite/create','AgentController@getInviteAgentUrl');

      Route::get('agent/view','AgentController@getAgentView');

    // 发货手机验证
    Route::get('sendGoods/','JsController@getScan');
    // 发货手机验证
    Route::get('sendGoods/isExistsMobile','GoodsController@isExistsMobile');

    // 发货订单入库
    Route::post('sendGoods/addOrder','OrderController@postSendGoods');
    Route::post('sendGoods/change-status','OrderController@postChangeOrderStatus');
});
